// 引入ReactDOM的createRoot
import {createRoot} from 'react-dom/client'
// 引入App组件
import App from './App'
import store from './redux/store'

const containter = document.getElementById('root')
const root = createRoot(containter)
// 渲染App到页面
root.render(<App/>)

// 监测redux中状态的改变，如redux的状态发生了改变，那么重新渲染App组件
store.subscribe(() => {
  root.render(<App/>)
})